package org.studiox.graph.common;

import java.util.Objects;

/** The Define of Common Graph Edge */
public class GraphEdge {

  /** the unique name of the edge */
  private String uniq;

  /** the type of the edge */
  private String type;

  /** the status of the edge */
  private Boolean deleted;

  /** the unique name of the source vertex */
  private String sourceVertexUniq;

  /** the unique name of the target vertex */
  private String targetVertexUniq;

  /** the create time of the edge */
  private Long createTime;

  public String getUniq() {
    return uniq;
  }

  public void setUniq(String uniq) {
    this.uniq = uniq;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public Boolean getDeleted() {
    return deleted;
  }

  public void setDeleted(Boolean deleted) {
    this.deleted = deleted;
  }

  public String getSourceVertexUniq() {
    return sourceVertexUniq;
  }

  public void setSourceVertexUniq(String sourceVertexUniq) {
    this.sourceVertexUniq = sourceVertexUniq;
  }

  public String getTargetVertexUniq() {
    return targetVertexUniq;
  }

  public void setTargetVertexUniq(String targetVertexUniq) {
    this.targetVertexUniq = targetVertexUniq;
  }

  public Long getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Long createTime) {
    this.createTime = createTime;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GraphEdge graphEdge = (GraphEdge) o;
    return Objects.equals(uniq, graphEdge.uniq)
        && Objects.equals(type, graphEdge.type)
        && Objects.equals(deleted, graphEdge.deleted)
        && Objects.equals(sourceVertexUniq, graphEdge.sourceVertexUniq)
        && Objects.equals(targetVertexUniq, graphEdge.targetVertexUniq)
        && Objects.equals(createTime, graphEdge.createTime);
  }

  @Override
  public int hashCode() {
    return Objects.hash(uniq, type, deleted, sourceVertexUniq, targetVertexUniq, createTime);
  }

  @Override
  public String toString() {
    final StringBuffer stringBuffer = new StringBuffer("GraphEdge{");
    stringBuffer.append("uniq='").append(uniq).append('\'');
    stringBuffer.append(", type='").append(type).append('\'');
    stringBuffer.append(", deleted=").append(deleted);
    stringBuffer.append(", sourceVertexUniq='").append(sourceVertexUniq).append('\'');
    stringBuffer.append(", targetVertexUniq='").append(targetVertexUniq).append('\'');
    stringBuffer.append(", createTime=").append(createTime);
    stringBuffer.append('}');
    return stringBuffer.toString();
  }
}
